package com.big_data_studio.util.general;

import com.big_data_studio.exception.CustomException;
import org.apache.http.HttpStatus;
import org.springframework.stereotype.Component;

@Component
public class isDeleteUtil{


    public static R isdelete(Integer isdelete, String option){
        if (isdelete==1){
            return R.error("数据已经被删除");
        }else {
            return R.ok(option+"成功");
        }
    }

    public static R isdelete(Integer isdelete,Object T,String option){
        System.out.println("isdelete = " + isdelete);
        if (isdelete==1){
            throw new CustomException(HttpStatus.SC_FORBIDDEN,"获取失败");
        }else {
            return R.ok(T,option+"成功");
        }
    }

}
